<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css" />
<script src="scripts/inframe.js"></script>
<body>
<div id="info"><font color="red">${info}</font></div>

<form action="${ctx}/titleClass/classFunc_modify.action" method="post">
		<input type="hidden" name="titleFunc.funcId" value="${titleFunc.funcId}"/>
		<input type="hidden" name="classCodeGroup" value="${classCodeGroup}"/>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab_m left">
  <tr>
    <td colspan="2" class="zctop"><span class="font14 zc_bt">修改功能子分类</span></td>
    </tr>
  <tr>
    <td class="w1 left">子功能编号：</td>
    <td class="w2"><input type="text" name="funcCode" class="fl_l" value="${funcCode }" /> 编号请尽量间隔开，2位数字<div id="errCode"></div></td>
  </tr>
  
	<tr>
		<td class="w1 left">
			上级栏目：
		</td>
		<td class="w2">
			<input type="hidden" name="classCode" value="${classCode }" class="fl_l"/>
			<input type="text" name="className" value="${className}" class="fl_l" readonly />				
		</td>
	</tr>
  
  <tr>
    <td class="w1 left">子功能名称：</td>
    <td class="w2"><input type="text" name="titleFunc.funcName" class="fl_l" value="${titleFunc.funcName }" /><div id="errName"></div></td>
  </tr>
  <tr>
    <td colspan="2" class="hei_1">
    <input type="button" onclick="modfyFunc();" value="确 定" class="log_f zc_b">
	<input type="button" onclick="returnFunc();" value="返 回" class="log_f zc_b">
    </td>
    </tr>
</table>
</form>
</body>
</html>
<script type="text/javascript" src="${ctx}/scripts/commons/validation.js"></script>
<script type="text/javascript">

	function modfyFunc (){
		var code = document.getElementById("funcCode").value ;
		var name = document.getElementById("titleFunc.funcName").value;		

	var flag1 = /^[0-9]{2}$/;
	if(!flag1.test(code)){
		document.getElementById("errCode").innerHTML = "<font color='red'>编号必须是两位数字</font>";
	   return false;
	}
	if(code.length > 2){
		document.getElementById("errCode").innerHTML = "<font color='red'>编号必须是两位数字</font>";
	   return false;
	}
	if(code.length == 0 && name.length == 0){
	   document.getElementById("errName").innerHTML = "<font color='red'>不能添加空的功能节点</font>";
	   return false;
	}
	if(name == '' || name.length == 0){
	   document.getElementById("errName").innerHTML = "<font color='red'>功能名称不能为空</font>";
	   return false;
	}

	if(name.length > 0 && hasSpecialChart(name)){
			document.getElementById("errName").innerHTML = "<font color='red'> 功能名称不能有特殊字符!</font>";
			return false;
	}
	if(name.length > 50){
	   document.getElementById("errName").innerHTML = "<font color='red'>功能名称不能超过50</font>";
	   return false;
	}
	if(name.length > 0 && (code.length == 0)){
	   document.getElementById("errName").innerHTML = "<font color='red'>功能编号不能为空</font>";
	   return false;
	}
	 
	 document.forms[0].submit();		 
	}
	
	
	function returnFunc(){
		document.getElementById("funcCode").value = "";
		document.getElementById("titleFunc.funcName").value = "";
		
		history.go(-1);
	}
</script>
